package org.mayuanxiaonong.timservice.service.impl;

import org.mayuanxiaonong.timservice.dao.UserDao;
import org.mayuanxiaonong.timservice.pojo.Presence;
import org.mayuanxiaonong.timservice.pojo.User;
import org.mayuanxiaonong.timservice.service.UserService;
import org.mayuanxiaonong.timservice.util.MD5;

public class UserServiceImpl implements UserService {

	private UserDao userDaoMongo;

	@Override
	public boolean login(int uid, String password) {
		User user = userDaoMongo.getUser(uid);
		return MD5.md5(password).equalsIgnoreCase(user.getPassword());
	}

	@Override
	public void savePresence(Presence presence) {
		userDaoMongo.savePresence(presence);
	}

}
